import request from '@/utils/request'

// 行政复议监督流程功能
const businesssuperviseApi = {
    startBusinessProced: '/businesssupervise/startBusinessProced', // 启动一个业务子流程
    completeToNext: '/businesssupervise/completeToNext', // 进行完成操作
    completeMaterial: '/businesssupervise/completeMaterial', // 整改完成操作
    completeEnd: '/businesssupervise/completeEnd' // 整改提交操作

}

/**
 * 启动业务子流程
 * @param {*} applyid
 * @param {*} proctype
 * @param {*} userid
 * @returns
 */
export function startBusinessProced (params, docfiled) {
    return request({
        url: businesssuperviseApi.startBusinessProced,
        method: 'post',
        params: params,
        data: docfiled
    })
}

/**
 * 进行完成操作 审批完成和整改完成
 * @param {} applyid
 * @param {*} taskid
 * @param {*} userid
 * @param {*} type  0:审查完成 , 1： 整改完成
 * @returns
 */
export function completeToNext (applyid, taskid, userid) {
    return request({
        url: businesssuperviseApi.completeToNext,
        method: 'post',
        params: { applyid, taskid, userid }
    })
}

/**
 * 进行整改完成操作
 * @param {*} applyid
 * @param {*} taskid
 * @param {*} userid
 * @returns
 */
export function completeMaterial (applyid, taskid, userid) {
    return request({
        url: businesssuperviseApi.completeMaterial,
        method: 'post',
        params: { applyid, taskid, userid }
    })
}

/**
 * 整改步骤 点击提交操作
 * @param {*} applyid
 * @param {*} taskid
 * @param {*} userid
 * @returns
 */
export function completeEnd (applyid, taskid, userid) {
    return request({
        url: businesssuperviseApi.completeEnd,
        method: 'post',
        params: { applyid, taskid, userid }
    })
}

